package ubc.cs.cpsc210.sustainabilityapp.model;

/**
 * Represent a food service location
 */
public class FoodService extends PointOfInterest {
	
	// The rating for the food service location
	private double rating;
	
	// The number of reviews for the food service location
	private int reviews;
	
	// The url for the food service location
	private String url;
	
	// The category for the food service location
	private String category;
	
	/**
	 * Constructor
	 * 
	 * <br><br>
	 * <b>Requires:</b> <br> id must be unique across all POIs and id and
	 * displayName are non-empty strings.<br><br>
	 * <b>Modifies:</b><br>(Similar to all constructors, modifies this)<br><br>
	 * <b>Effects:</b> <br> id and displayName are remembered in object.
	 * 
	 * @param id The identifier for the building.
	 * @param displayName The name to use when displaying the building.
	 */
	public FoodService(String id, String displayName) {
		super(id, displayName);
		rating = 0;
		reviews = 0;
	}
	
	/**
	 * Return the rating for the food service outlet.
	 * 
	 * <br><br>
	 * <b>Effects:</b><br>Returns the rating for the food service outlet which is >= 0
	 * <br><br>
	 * 
	 * @return The rating for the food service outlet
	 */
	public double getRating() { return rating; }
	
	
	/**
	 * Return the number of reviews known for the food service location.
	 * 
	 * <br><br>
	 * <b>Effects:</b><br>Returns the number of reviews for the food service location, which is >= 0
	 * <br><br>
	 * 
	 * @return The number of reviews for the food service outlets
	 */
	public int getReviewCount() { return reviews; }
	
	public String getUrl() { return url; };
	
	public String getCategory() { return category; };
	
	/**
	 * Set the rating for this food service location.
	 * 
	 * <br><br>
	 * <b>Requires:</b><br>rating >= 0<br><br>
	 * <b>Modifies:</b><br>this<br><br>
	 * <b>Effects:</b><br>Remembers the given rating<br><br>
	 * 
	 * @param rating The rating for the food service location
	 */
	public void setRating(double rating) {
	    this.rating = rating;
	}
	
	/**
	 * Set the number of reviews for this food service location.
	 * 
	 * <br><br>
	 * <b>Requires:</b><br>The number of reviews for the food service location which is >= 0<br><br>
	 * <b>Modifies:</b><br>this<br><br>
	 * <b>Effects:</b><br>Remembers the given number of reviews.<br><br>
	 * 
	 * @param reviews The rating for the food service location
	 */
	public void setReviewCount(int reviews) {
	    this.reviews = reviews;
	}
	
	public void setUrl(String url) {
		this.url = url;
	}
	
	public void setCategory(String category) {
		this.category = category;
	}
	
	@Override
	public String toString() { return getId(); }

	public int compareTo(FoodService r2) {
		return this.getDisplayName().compareTo(r2.getDisplayName());
	}
}
